#pragma once

//#include "Math/Spline.h"
#include "CoSyNE.h"
#include "Draw.h"



//+==================================================================+
class Paths : public CoSyNE
{
	const	int N;								// # of bezier curves

public:
//////////////////////////////////////////////////////////////////////
//	Each Path is defined by 8 floats.
	Paths(int num, int pop);// : CoSyNE(num*(sizeof(float)/sizeof(Path)), 0, pop), N(num), distances(NULL){}

//+------------------------------------------------------------------+
				Path*	getPaths					(int sample)			{	return (Path*)P.getCol(sample);	}

//+------------------------------------------------------------------+
	virtual	void	randomizeSample		(int sample);
	virtual	void	sampleMutateWeights	(int sample);
				float	arrangeDistance		(int sample);
				void	evaluate					(int sample, float fitnessBias = 0);

//+------------------------------------------------------------------+
//	distances between the endpoints
	const float *distances;
};




//+------------------------------------------------------------------+
//	Creates smooth paths, including end points.
//	The paths are correlated and temporally and spatially consistent,
//	not closer than necessary to surrounding hit points
	void OptimizePaths(std::vector<FlyingButton> &buttons, int population = 256, float aspectRatio = 1.33333333333333f);



